<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>练习3</title>
    <style type="text/css">
     .topnav{
        border-style: solid;
        background-color: black;
        border-color: white;
        height: 40px;
        padding-top: 20px;
     }
     .topnav a{
        margin-right: -5px;
        padding: 20px 15px;
        text-decoration:none;color:white;
     }
     .topnav a:hover{
        padding: 20px 15px;
        background-color: gray;
        
     }
     .topnav .active{
        padding: 20px 15px;
        background-color: green;
     }
    </style>
</head>

<body>
<div class="topnav">
    <a class="active" href="#home">主页</a>
    <a href="#news">新闻</a>
    <a href="#contact">联系方式</a>
    <a href="#about">关于我们</a>
</div>

<div style="padding-left:16px">
    <h2>顶部导航实例</h2>
    <p>信息内容..</p>
</div>
</body>
</html>
